<div>
    <?php $view->DropDownMenu()->operationControllers($view->em, $view->controller); ?>
</div>
<br/>
<?php if (count($view->drivers) == 0): ?>
    <div class="alert alert-info">
        <p>
            No se han definido conductores o todos los conductores disponibles
            ya se encuentran asignados a este controlador de operaciones (<?php echo $view->controller->getFullName(); ?>).
        </p>
    </div>
    <a class="btn btn-primary" href="<?php
    echo $view->url(array(
        'controller' => 'AdminUsers',
        'action' => 'index',
    ));
    ?>">
        Agregar conductores
    </a>
<?php else: ?>
    <form method="post" role="form" action="<?php echo $view->url(array('action' => 'drivers'), true); ?>">
        <div class="form-group">
            <input type="hidden" name="action" value="add"/>
            <input type="hidden" name="controller" value="<?php echo $view->controller->getId(); ?>"/>
            <label>Controlador de operaciones</label>
            <p class="form-control-static">
                <?php echo $view->controller->getFullName(); ?>
            </p>
        </div>
        <div class="form-group">
            <label for="driver">Conductores vigentes</label>
            <select class="form-control" name="driver" id="driver">
                <?php foreach ($view->drivers as $driver): ?>
                    <option value="<?php echo $driver->getId(); ?>"><?php echo $driver->getFullName(); ?></option>
                <?php endforeach; ?>
            </select>
        </div>
        <div class="form-group">
            <button class="btn btn-primary">
                Asignar
            </button>
        </div>
    </form>
<?php endif; ?>
